package com.example.demo.controller;

import com.example.demo.entity.WiselyMessage;
import com.example.demo.entity.WiselyResponse;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

/**
 * @author ml
 * @create 2017-07-14--11:05
 */
@Controller
public class WsController {


    @MessageMapping("/welcome")
    @SendTo("/topic/getResponse")
    public WiselyResponse say(WiselyMessage message) throws InterruptedException {
        Thread.sleep(3000);
        return new WiselyResponse(("欢迎使用websocket"+message.getName()));
    }
}
